<template>
    <h2>登录列表</h2>
    <table class="table  table-bordered ">
        <tr>
            <td>用户编号</td>
            <td>用户名</td>
            <td>密码</td>
        </tr>
        <tr v-for="item in info">
            <td>{{item.Uid}}</td>
            <td>{{item.Uname}}</td>
            <td>{{item.Upwd}}</td>
        </tr>
    </table>
</template>
<script setup lang="ts">
import { ref,onMounted } from 'vue';
import { useRouter, useRoute} from 'vue-router';
import axios from 'axios';

const router = useRouter();
const route = useRoute();

const info = ref({
    Uid:0,
    Uname: '',
    Upwd: ''
});

onMounted(() => {
    Show();
})

const Show = () => {
    axios({
        method: 'get',
        url: 'http://localhost:61498/api/User/UserShow',
    })
    .then(res => {
        info.value = res.data;
        console.log(res.data);
    })
    .catch(err => {
        console.log(err);
    })
}
</script>